-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(analyzer): Add a test for dangling embed directives / GoMod #7647
Conversation
563e9f0
to
aba9c4d
Compare
@@ -100,7 +100,7 @@ class GoMod( | |||
|
|||
override fun transformVersion(output: String) = output.removePrefix("go version go").substringBefore(' ') | |||
|
|||
override fun getVersionRequirement(): RangesList = RangesListFactory.create(">=1.19.0") | |||
override fun getVersionRequirement(): RangesList = RangesListFactory.create(">=1.21.1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message:
- "this projects" -> "the projects"
@@ -0,0 +1,3 @@ | |||
module gomod_dangling_embed | |||
|
|||
go 1.19 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this also be 1.21.1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why exactly should it be? (As-is it is consistent with the other test cases in GoModFunTest
).
One aspect of the bug fix is in the tooling of version 1.21, but that tooling can be used with 1.19 projects, so I do not see an issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One aspect of the bug fix is in the tooling of version 1.21, but that tooling can be used with 1.19 projects
That was the missing piece of information for me here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the missing piece of information for me here.
Ok, so are we good to go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that regard yes, but I does not make sense for me to approve before the commit message is fixed.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7647 +/- ##
=========================================
Coverage 68.03% 68.03%
Complexity 2023 2023
=========================================
Files 344 344
Lines 16727 16727
Branches 2372 2372
=========================================
Hits 11381 11381
Misses 4363 4363
Partials 983 983
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
aba9c4d
to
8532c14
Compare
8532c14
to
97b10c6
Compare
Note that commit-lint still fails. |
97b10c6
to
14c3077
Compare
It seems it flags references to issues using hash in the middle of a sentence without a preceding keyword like "Fixes". My work around is to use a reference e.g. [5]. |
That's as well the only work-around I'm aware of. |
The `GoMod` integration does not execute `go generate/go build`, so the embed directive in `main.go` points to a non-existing file. When `GoMod` executes [1] it failed [2] with the previously used Go version 1.20.5. As of [3], with Go version 1.21.1, that issue is fixed. Add a test to ensure it keeps on working. Note: It is essential to pass `json=Module` instead of not just `-json` [4], because otherwise the issue would still persist on Go 1.21.1. So, [3] and [4] together fix [5]. Fixes #5560. [1] `go list -deps -json=Module -buildvcs=false ./...` [2] `pattern file.txt: no matching` [3] 47e4520 [4] 43ad3a7 [5] #5560. Signed-off-by: Frank Viernau <[email protected]>
Ensure that projects containing the embed directive can be analyzed without issues, see also the preceeding commit. Signed-off-by: Frank Viernau <[email protected]>
14c3077
to
a295ca4
Compare
The
GoMod
integration does not executego generate/go build
, so the embed directive inmain.go
points to a non-existing file. WhenGoMod
executes [1] it failed [2] with the previously used Go version 1.20.5. As of [3], with Go version 1.21.1, that issue is fixed.Add a test to ensure it keeps on working.
Note: It is essential to pass
json=Module
instead of not just-json
[4], because otherwise the issue would still persist onGo 1.21.1.
Fixes #5560.
[1]
go list -deps -json=Module -buildvcs=false ./...
[2]
pattern file.txt: no matching
[3] 47e4520
[4] 43ad3a7
Please ensure that your pull request adheres to our contribution guidelines. Thank you!